﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AirlineProject.Models;

namespace AirlineProject.Areas.admin.Controllers
{
    public class AddController : Controller
    {
        //
        // GET: /admin/Them/

        public ActionResult addflight()
        {
            return View();
        }
        public ActionResult adduser()
        {
            return View();
        }
        public ActionResult addorigin()
        {
            return View();
        }
        public ActionResult adddestination()
        {
            return View();
        }
        public ActionResult addtypeticket()
        {
            return View();
        }
        public ActionResult addformpayment()
        {
            return View();
        }

        public ActionResult handaddflight(int orgin_id, int destination_id, string departure_date, double flight_price, int seat_num)
        {
            DataModels da = new DataModels();
            string v = string.Empty;
            if (da.Addflight(orgin_id, destination_id, (Convert.ToDateTime(departure_date)), flight_price, seat_num))
            {
                v = "flight";
            }
            else
            {
                v = "them";
                ViewData["message"] = "add flight failed";
            }
            return View(v);
        }

    }
}
